//
// Created by jie.jiang on 2022/12/8.
//

#ifndef FOC_LOOP_TIME_UTILS_H
#define FOC_LOOP_TIME_UTILS_H
#include "stdint.h"

#define  DWT_CYCCNT  *(volatile unsigned int *)0xE0001004
#define  DWT_CR      *(volatile unsigned int *)0xE0001000
#define  DEM_CR      *(volatile unsigned int *)0xE000EDFC
#define  DBGMCU_CR   *(volatile unsigned int *)0xE0042004

#define  DEM_CR_TRCENA               (1 << 24)
#define  DWT_CR_CYCCNTENA            (1 <<  0)

void DWT_Init(void);
void delay_us(uint32_t _ulDelayTime);
void delay_ms(uint32_t _ulDelayTime);

#endif //FOC_LOOP_TIME_UTILS_H
